<?php
/**
 * ある数以上かチェックする
 *
 * @category   Zend
 * @package
 * @copyright  fujiwara
 * @license
 */
class Validate_MoreThan extends Zend_Validate_GreaterThan
{

	const NOT_MORE = 'notMoreThan';

	/**
	* @var array
	*/
	protected $_messageTemplates = array(
		self::NOT_MORE => "'%value%' is not over than '%min%'",
	);

	/**
	* @var array
	*/
	protected $_messageVariables = array(
	        'min' => '_min'
	);

	/**
	 * Minimum value
	 *
	 * @var mixed
	 */
	protected $_min;

    /**
     * Defined by Zend_Validate_Interface
     *
     * ある数以上か検証
     *
     * @param  mixed $value
     * @return boolean
     */
    public function isValid($value)
    {
        $this->_setValue($value);

        if ($this->_min > $value) {
            $this->_error(self::NOT_MORE);
            return false;
        }

        return true;
    }
}